package br.ufrpe.bsi.pvs.xml.request;

import br.ufrpe.bsi.pvs.xml.XMLUtil;

/** Fabrica de processadores de request. */
public class RequestProcessorFactory {

	/** gets a request type and returns the correct request processor instance */
	public static RequestProcessor getRequestProcessor(String requestType) {
		switch (requestType) {
		case XMLUtil.ADD:
			return new AddRequestProcessor();
			
		case XMLUtil.LIST:
			return new ListRequestProcessor();
			
		case XMLUtil.QUERY:
			return new QueryRequestProcessor();
			
		case XMLUtil.LOGIN:
			return new LoginRequestProcessor();
			
		default:
			return null;
		}
	}
}
